load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "rowenc",
    srcs = [
        "encoded_datum.go",
        "index_encoding.go",
        "index_fetch.go",
        "partition.go",
        "roundtrip_format.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/rowenc",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/geo/geoindex",
        "//pkg/geo/geopb",
        "//pkg/keys",
        "//pkg/kv",
        "//pkg/roachpb",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/catalogkeys",
        "//pkg/sql/catalog/catenumpb",
        "//pkg/sql/catalog/colinfo",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/catalog/fetchpb",
        "//pkg/sql/inverted",
        "//pkg/sql/parser",
        "//pkg/sql/rowenc/keyside",
        "//pkg/sql/rowenc/rowencpb",
        "//pkg/sql/rowenc/valueside",
        "//pkg/sql/sem/eval",
        "//pkg/sql/sem/tree",
        "//pkg/sql/sqlerrors",
        "//pkg/sql/types",
        "//pkg/util/buildutil",
        "//pkg/util/encoding",
        "//pkg/util/intsets",
        "//pkg/util/json",
        "//pkg/util/mon",
        "//pkg/util/protoutil",
        "//pkg/util/trigram",
        "//pkg/util/tsearch",
        "//pkg/util/unique",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_redact//:redact",
    ],
)

go_test(
    name = "rowenc_test",
    size = "medium",
    srcs = [
        "encoded_datum_test.go",
        "index_encoding_test.go",
        "index_fetch_test.go",
        "main_test.go",
        "roundtrip_format_test.go",
    ],
    data = glob(["testdata/**"]),
    deps = [
        ":rowenc",
        "//pkg/base",
        "//pkg/keys",
        "//pkg/kv",
        "//pkg/roachpb",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/server",
        "//pkg/settings/cluster",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/catenumpb",
        "//pkg/sql/catalog/colinfo",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/catalog/desctestutils",
        "//pkg/sql/catalog/fetchpb",
        "//pkg/sql/catalog/tabledesc",
        "//pkg/sql/inverted",
        "//pkg/sql/parser",
        "//pkg/sql/randgen",
        "//pkg/sql/rowenc/valueside",
        "//pkg/sql/sem/eval",
        "//pkg/sql/sem/tree",
        "//pkg/sql/types",
        "//pkg/testutils/datapathutils",
        "//pkg/testutils/serverutils",
        "//pkg/util",
        "//pkg/util/encoding",
        "//pkg/util/json",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/randutil",
        "//pkg/util/trigram",
        "//pkg/util/uuid",
        "@com_github_cockroachdb_apd_v3//:apd",
        "@com_github_cockroachdb_datadriven//:datadriven",
        "@com_github_stretchr_testify//require",
        "@in_gopkg_yaml_v2//:yaml_v2",
    ],
)
